using System;
using System.Runtime.InteropServices;
using System.Security;
using WindowsAPI.Service;

namespace WindowsAPI
{
    [SuppressUnmanagedCodeSecurity, Dll(FileName)]
    public static class GDIPlus
    {
        public const string FileName = "gdiplus.dll";

        /* ------------------------------------------------------------------------------------------ */

        [DllImport(FileName, ExactSpelling = true)]
        public static extern int GdipCreateBitmapFromGdiDib(IntPtr bminfo, IntPtr pixdat, ref IntPtr image);

        [DllImport(FileName, ExactSpelling = true, CharSet = CharSet.Unicode)]
        public static extern int GdipSaveImageToFile(IntPtr pImage, string filename, [In] ref Guid clsid, IntPtr encparams);

        [DllImport(FileName, ExactSpelling = true)]
        public static extern int GdipDisposeImage(IntPtr pImage);
    }
}